using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_hr_saoudisMap : EntityTypeConfiguration<so_hr_saoudis>
    {
        public so_hr_saoudisMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Employee_Classification, t.Saudization_weight, t.TotalEmployee });

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.Employee_Classification)
                .IsRequired()
                .HasMaxLength(21);

            this.Property(t => t.Saudization_weight)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.TotalEmployee)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("so_hr_saoudis");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Employee_Classification).HasColumnName("Employee_Classification");
            this.Property(t => t.Saudization_weight).HasColumnName("Saudization_weight");
            this.Property(t => t.TotalEmployee).HasColumnName("TotalEmployee");
        }
    }
}
